package com.woniuxy.service;

import com.fasterxml.jackson.core.JsonProcessingException;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.woniuxy.controller.form.AddCartForm;
import com.woniuxy.controller.form.DelCartForm;
import com.woniuxy.dao.model.CartInfo;
import com.baomidou.mybatisplus.extension.service.IService;
import com.woniuxy.service.dto.AllCartListDto;

import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务类
 * </p>
 *
 * @author psy
 * @since 2022-06-28
 */
public interface CartInfoService extends IService<CartInfo> {

    Boolean addCart(AddCartForm addCartForm) throws JsonProcessingException;


    ArrayList<AllCartListDto> getAllCartsByCustomerId(Long customerId) throws JsonProcessingException;

    void RedisAddByObjectJson(Object o,Long id) throws JsonProcessingException;

    void RedisAddByListJson(List list,Long id)throws JsonProcessingException;

    Boolean delCart(DelCartForm delCartForm) throws JsonProcessingException;

    Boolean delCarts(Long id, String storeName) throws JsonProcessingException;

    ArrayList<AllCartListDto> loadStoreByStore(String storeName);

    AllCartListDto findCart(String foodName) throws JsonProcessingException;
}
